package emap;

import javax.swing.JFrame;
//Fullscreen stuff
import java.awt.GraphicsDevice;
import java.awt.DisplayMode;
import java.awt.GraphicsEnvironment;

public class Mappy_v2 extends JFrame {
    public Mappy_v2() {
    	boolean fullscreenmode=false;
    	GraphicsEnvironment stdge=GraphicsEnvironment.getLocalGraphicsEnvironment();
        GraphicsDevice stdgd=stdge.getDefaultScreenDevice();
        if(stdgd.isDisplayChangeSupported()) 
        {
        	System.out.println("WOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOHHHHHHH");
        	fullscreenmode=true;
        }
        add(new Board());
        if(fullscreenmode){
        setUndecorated(true);
        stdgd.setDisplayMode(new DisplayMode(640,480,32,60));
        DisplayMode[] displist=stdgd.getDisplayModes();
        GraphicsDevice[] gdlist=stdge.getScreenDevices();
        System.out.println(gdlist.length);
        for(int a=0;a<gdlist.length;a++){
        	System.out.println(gdlist[a].getIDstring());
        }
        
        for(int a=0;a<displist.length;a++){
        	System.out.println(""+displist[a].getWidth()+"x"+displist[a].getHeight()+"d"+displist[a].getBitDepth()+"r"+displist[a].getRefreshRate());
        }
        stdgd.setFullScreenWindow(this);
        } else {
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setSize(646, 512);
        setLocationRelativeTo(null);
        setTitle("Mappy - v2 ^_^");
        setResizable(true);
        setVisible(true);
        }
    }

    public static void main(String[] args) {
        new Mappy_v2();
    }
}